package MTT::Libs::Report::SimpleReport;

use Moose;
use MTT::Libs::Report;

has schema => ( is => 'rw', required => 1 );

sub get_report {
	my ($self, $report) = @_;

	my $data = $self->schema->storage->dbh_do(
		sub {
			my ($storage, $dbh, @params) = @_;

			return $dbh->selectall_arrayref(
#				'SELECT id, attempts_bi, attempts_in, attempts_out, answ_bi, answ_in, answ_out'
#				. '	FROM finish_report_data limit 100'
				'SELECT * FROM finish_report_data LIMIT 50'
			);
		}
	);

	foreach my $row ( @$data ) {
		foreach my $col ( @$row ) {
			$col = '-' unless $col;
		}
	}

	return $data;
}

__PACKAGE__->meta->make_immutable;
1;
